﻿//----------------------------------------------------

#region 命名空间

//    版权：
//    作者：
//建立时间：2012-09-11 00:00:33
//    描述：
//----------------------------------------------------
using System;
using System.Data;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Collections.Generic;
using WinnerCMS.Data;
using WinnerCMS.Model;
using WinnerCMS.Common;

#endregion

namespace WinnerCMS.BLL
{
    /// <summary>
    /// 业务逻辑类 WinnerCMS_PriceChanges 的摘要说明。
    /// </summary>
    public class PriceChangesManage
    {
        private static readonly PriceChangesDal MyDAL = new PriceChangesDal();

        #region 添加

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <param name="strErr"></param>
        public void Add(PriceChange model, ref string strErr)
        {
            if (model.OrderNum.Length == 0)
            {
                strErr = "“订单号”不能为空！";
                return;
            }


            if (model.Admin == 0)
            {
                strErr = "“管理员”不能为空！";
                return;
            }
            if (model.IP.Length == 0)
            {
                strErr = "“IP”不能为空！";
                return;
            }

            MyDAL.Add(model);
        }

        #endregion

        #region 删除

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="IDs"></param>
        /// <param name="UpdatePanel1"></param>
        public void Delete(string IDs, UpdatePanel UpdatePanel1)
        {
            if (string.IsNullOrEmpty(IDs))
            {
                MsgBox.Message("至少选择一项。", UpdatePanel1);
            }
            else
            {
                MyDAL.Delete(MyConvert.ConvertToArr(IDs));
            }
        }

        #endregion

        /// <summary>
        /// 绑定分页数据
        /// </summary>
        /// <param name="orderNum"></param>
        /// <param name="pp"></param>
        /// <returns></returns>
        public IList<PriceChange> BindList(string orderNum, PagingParam pp)
        {
            return MyDAL.BindList(orderNum, pp);
        }
    }
}